<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        <hello-age>
            <template slot="head">
                <div>我是头</div>
                <div>我是导航</div>
            </template>
            <div>我是主体</div>
            <div>我是主体</div>
            <div>我是主体</div>
            <div>我是主体</div>
            <div>我是主体</div>
            <div>我是主体</div>
            <div slot="foot">
                我是尾部
            </div>
        </hello-age>
    </div>
    <script>
        Vue.component('hello-age', {
            props: ['list'],
            data: function() {
                return {
                    name: 'Tom'
                }
            },
            template: `
            <div>
                <header>
                    <slot name="head"></slot>
                </header>
                <main>
                    <slot></slot>
                </main>
                <footer>
                    <slot name="foot"></slot>
                </footer>
            </div>
            `
        })
        var vm = new Vue({
            el: '#app',
            data: {
                age: 3
            }
        })
    </script>
</body>

</html>